package chat;

public enum MessageType { Message(1),Server(2),PrivateMessage(3),Team(4),System(5),Join(6),
Leave(7),MOTD(8);
	
	private int value;
	
	private MessageType(int value) 
	{
	        this.value = value;
	}
	public int getValue()
	{
		return value;
	}
	public static MessageType fromInt(int code) {
		
		switch(code) 
		{
			case 1:
				return Message;
			case 2:
				return Server;
			case 3:
				return PrivateMessage;
			case 4:
				return Team;
			case 5:
				return System;
			case 6:
				return Join;
			case 7:
				return Leave;
			case 8:
				return MOTD;
			}
		return null;
	}
}
